const path = require('path')

module.exports = {
  devServer: {
    open: true,
    port: 1103,
    proxy: {
      '/api': {
        target: 'https://mock.mengxuegu.com/mock/61a85f50c6b34465f53dba9e',
        changeOrigin: true,
        pathRewrite: {
          '^/api': '/api'
        }
      }
    }
  },
  lintOnSave: true,
  chainWebpack: config => {
    config.resolve.alias
      .set('@', path.join(__dirname, 'src'))
      .set('@views', path.join(__dirname, 'src/views'))
      .set('@utils', path.join(__dirname, 'src/utils'))
      .set('@api', path.join(__dirname, 'src/api'))
      .set('@router', path.join(__dirname, 'src/router'))
      .set('@components', path.join(__dirname, 'src/components'))
      .set('@assets', path.join(__dirname, 'src/assets'))
      .set('@store', path.join(__dirname, 'src/store'))
  }
}
